<?php
  require_once('inc_admin.php');
  //连接数据库 
  connect();
  //使用$_POST数组获取表单中输入的数据
  $id = $_POST['vid'];


  

  $data = array(

    'vid' => trim($_POST['vid']),  
    'tid' => $_POST['tid'],
    'videoname' => $_POST['videoname'],
      );

  $result = update('videos',$data,'vid='.$id);
  
 if(!$result){
    echo "更新失败！<br/>";
    echo "<a href='VTReg.html'>返回</a>";} 
  
  else{    
    redirect('VTList.php', '更新成功！');
  }    

   /* $sql = "update users set uname='{$uname}', birthdate='{$birthdate}', gender={$gender}, hobby='{$hobby}', degree={$degree},intro='{$intro}', pic='{$newname}' where uid={$id}";  
  $result = mysql_query($sql) or die("sql={$sql}, 更新失败！<br/>".mysql_error());*/
  //判断是否更新成功
 ?>
